package server.tests;

public class RandomMethodsTest {
	static int[] rangeMass = {22,27};
	
	public static double calcRandomMass() {
		int lowerLimitExp = rangeMass[0];
		int upperLimitExp = rangeMass[1];
		
		int randomExp = (int)((Math.random() * (upperLimitExp +1 - lowerLimitExp) + lowerLimitExp));
		double randomDouble = ((Math.random() * 9)+1);;
		
		randomDouble *=   Math.pow(10, randomExp);
		return randomDouble;
		
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		System.out.println("random double between " +1.0 * Math.pow(10, rangeMass[0]) +" and " +9.99 * Math.pow(10, rangeMass[1]) +": " +calcRandomMass());
		System.out.println("random double: " +((Math.random() * 9)+1));
		System.out.println("random exp: " +(int)((Math.random() * (28 - 22) + 22)));
		System.out.println(Math.pow((10), 27)*9.99);

	}

}
